Providing services across systems that manage distributed replicas

ABSTRACT

Techniques are provided to allow users to define a global service that is offered across multiple replicated databases. Database clients connect to and use a global service just as they do with regular services on a single database today. Upon receiving a connection request, a collection of components, referred to collectively as the Global Data Service framework (GDS framework), automatically chooses the best database server instances to which to connect a client. Once those connections have been established, the clients determine which database server instance, of those database server instances to which they are connected, to send requests to based, at least in part, on advisory messages sent to the clients by the GDS framework.

FIELD OF THE INVENTION

The present invention relates to providing services across systems thatmanage distributed replicas and, more specifically, to a global dataservice framework for managing connections to and load balancing amongsuch systems, and to manage failover of services across these replicas.

BACKGROUND

For a variety of reasons, many businesses maintain many copies of thesame data. For example, an international corporation may replicatecritical data across many databases located around the world. Reasonsfor maintaining multiple replicas of the same data include, but are notlimited to:

-   business continuity and disaster recovery;-   performance optimization for local clients;-   content localization and caching;-   compliance to local laws; and-   integration of datacenters obtained through mergers and    acquisitions.

While maintaining several replicas of the same data may provide multiplebenefits, it can also be cumbersome if not managed efficiently.Consequently, database systems have been developed which provide“database services” and which allow service-level workload managementacross the database server instances that belong to the same clustergrid.

Unfortunately, managing workload across the database server instancesthat belong to a cluster grid does not account for the potentiallynumerous replicas that are being maintained outside that grid. Adistributed environment typically supports a greater degree ofheterogeneity than a cluster. For example, within a distributedenvironment, the various systems across which replicas are maintainedmay have different hardware architectures, different operating systems,even different types of database systems. Unlike a cluster, databases ina distributed environment do not have access to shared storage forkeeping state. Hence, it would be desirable to have a mechanism by whichmultiple distributed replicas of the same data may be efficientlymanaged.

The approaches described in this section are approaches that could bepursued, but not necessarily approaches that have been previouslyconceived or pursued. Therefore, unless otherwise indicated, it shouldnot be assumed that any of the approaches described in this sectionqualify as prior art merely by virtue of their inclusion in thissection.

BRIEF DESCRIPTION OF THE DRAWINGS

In the drawings:

FIG. 1 is a block diagram of a distributed replication system managed bya global data service framework, according to an embodiment of theinvention;

FIG. 2 is a block diagram of the distributed replication system of FIG.1, where the various database systems are divided into regions,according to an embodiment of the invention;

FIG. 3 is a flowchart illustrating how to respond to a connectionrequest, according to an embodiment of the invention; and

FIG. 4 is a block diagram of a computer system upon which embodiments ofthe invention may be implemented.

DETAILED DESCRIPTION

In the following description, for the purposes of explanation, numerousspecific details are set forth in order to provide a thoroughunderstanding of the present invention. It will be apparent, however,that the present invention may be practiced without these specificdetails. In other instances, well-known structures and devices are shownin block diagram form in order to avoid unnecessarily obscuring thepresent invention.

General Overview

Techniques are described herein that allow users to define a globalservice that is offered across multiple replicated databases. Databaseclients connect to and use a global service just as they do with regularservices on a single database today. Upon receiving a connectionrequest, a collection of components, referred to herein collectively asthe Global Data Service framework (GDS framework), automatically choosesthe best database server instances to which to connect a client. Oncethose connections have been established, the clients determine whichdatabase server instance, of those database server instances to whichthey are connected, to send requests to based, at least in part, onadvisory messages sent to the clients by the GDS framework.

According to one embodiment, the GDS framework generates theload/performance information based on information pushed from thedatabases themselves. This is different from external boxes that mustlook at the externally-measurable behavior. Thus, instead of clientstrying to infer what they should do by looking at the external behaviorof the databases, the databases tell the client what they should do viathe GDS framework. Consequently, the GDS can be more proactive andpredictive. For example, the GSM may advise clients to move work awayfrom a database if the database is about to reach overload, about tostart a huge batch job, or if the database is about to undergo a plannedshutdown.

In one implementation, the GDS framework provides a single, central toolto add, remove, modify and relocate global services and view theirstatus on particular instances. The tool can also be used forconfiguring GDS framework and managing its components.

Significantly, the GDS framework may be implemented using heterogeneousdatabase environments. For example, the set of databases used by the GDSframework (collectively referred to herein as the “database cloud”) mayinclude clustered databases from any number of vendors, and singleinstance databases from any number of vendors, linked together throughany type of replication technology. Further, the GDS framework can beset up across databases running on different hardware/softwareplatforms.

According to one embodiment, while the GSM provides the loadbalancing/failover functions, the GSM only gets involved duringconnection establishment and in telling the client the relative‘goodness’ of the connections that a connection pool has. In such anembodiment, the GSM is not in the request path, so each client-serverroundtrip (SQL call) does not have an extra hop.

Example Distributed Replication System

Referring to FIG. 1, it is a block diagram of a distributed replicationsystem. Specifically, FIG. 1 illustrates a database cloud that includesfour database systems 130, 131, 132, and 134. Database system 130 is aclustered database system in which multiple database instances 102, 104and 106 access the same shared storage 122. On the other hand, databasesystems 131, 133 and 134 are single-instance database systems thatinclude database server instances 107, 108, and 110, respectively.Database server instance 107 manages data on storage 123. Databaseserver instance 108 manages data on storage 124. Database serverinstance 110 manages data on storage 126.

In the illustrated embodiment, various sets of data are replicated amongthe database systems 130. Specifically, replicas of a data set A aremanaged by all four systems 130, 131, 132 and 134. Replicas of a dataset B are managed by systems 130, 131 and 132. Replicas of a data set Care managed by systems 132 and 134. Finally, a data set D is managedexclusively by system 130.

Because database server instances 102, 104 and 106 belong to the samecluster, all database service instances 102, 104 and 106 can directlyaccess the replicas of data sets A, B and D that are stored on storage122. However, the database server instances 102, 104, and 106 cannotdirectly access the data managed by database server instances 107, 108and 110, since database server instances 107, 108 and 110 do not belongto the cluster of system 130. Similarly, database server instance 107can only directly access the replicas in systems 131. Database serverinstance 108 can only directly access the replicas in systems 132.Database server instance 110 can only directly the replicas in system134.

In the illustrated embodiment, five clients 152, 154, 156, 158 and 160are associated with system 130. Client 160 is also associated withsystem 131, illustrating that there need not be a one-to-onerelationship between clients and systems. System 132 is associated withone client 162, and system 134 is associated with two clients 164 and166. As shall be described in greater detail hereafter, rather thanissue connection requests directly to a database server instance withina system with which they are associated, the clients are configured toissue connection requests to a global data service framework 100. TheGDS framework 100, in turn, determines with which database serverinstances, within which system, to connect each client.

In addition, GDS framework 100 sends advisory messages to the clients toindicate to the clients to which database server instances the clientshould submit requests for any given global service. For example, in oneembodiment, the GDS framework 100 sends advisory messages that contain aset of percentages specifying the proportion of requests, for aparticular global service, to be sent to particular database serverinstances. Such advisory messages may be generated at regular timeintervals and/or in response to instance load changes that requireclient requests to be redistributed appropriately. Over time, thosepercentages for a given service may change, based on a variety offactors such as the workload each system is currently experiencing. Inresponse to such changes, the GDS framework 100 will change whichdatabase server instance(s) and/or percentages that is/are recommendedfor the service in the advisory messages sent to the client.

Significantly, systems 130, 131, 132 and 134 may be at the samelocation, at different locations near each other, distributed across thecountry, or distributed across the world. The techniques describedherein work with any system in which replicas of a data set aredistributed among different database systems, regardless of thegeographic proximity of those database systems to each other. However,as shall be described in greater detail below, the location of eachdatabase system may be a factor by which the global data serviceframework 100 determines which database server instance should serviceany given request.

Global Service Managers And Regions

In one embodiment, the global services framework 100 is implemented by aset of global service managers (GSMs), as illustrated in FIG. 2. One ormore of the global service managers are available to each databasesystem managed by the global services framework 100. Logically, theglobal service managers are separate from the database server systemswith which they interact. Thus, global service managers may be executedon the same machine as the database server instances, or may be executedon different machines than the machines that are executing the databaseserver instances with which the global service managers interact.

According to one embodiment, global service managers are grouped intoregions. Each region may include one or more global service managers,and be associated with one or more of the database systems with whichthe global service framework 100 interacts. For the purpose ofillustration, it shall be assumed that global service managers 202 and204 belong to a region X, which includes database systems 130 and 131.Global service managers 206 and 208 belong to a region Y, which includesdatabase system 132, and global service manager 210 belongs to a regionZ which includes system 134.

In this example, region X is associated with two database systems, andregions Y and Z are each associated with a single database system.However, as mentioned above, each region may be associated with anynumber of database systems. In one embodiment, database systems areassociated with the same region when the database servers have some formaffinity to each other. For example, database systems may be associatedwith the same region when they are geographically close to each other,or when they are connected to each other via a high speed interconnect.Preferably, the database systems that are grouped together in eachregion are those that have similar latencies from the perspective of theclients in the region to which the database systems are assigned. Thus,systems 130 and 131 have similar latencies from the perspective ofclients 152 to 160.

The global service manager that resides in the same region as a givenclient is referred to as a “local global service manager” relative tothat client. For example, referring to FIG. 2, global service managers202 and 204 reside in region X, and are therefore local to clients 152,154, 156, 158 and 160 and database server instances 102, 104, 106 and107. Global service managers 206 and 208 reside in region Y, and arelocal to client 162 and database server instance 108. Global servicemanager 210 resides in region Z and is local to clients 164 and 166 anddatabase server instance 110.

Each global service manager, acts as a regional listener that is used byclients to connect to global services. According to one embodiment,client connection requests are randomly distributed among all regionalGSMs. Each GMS also measures the network latency and bandwidth betweenits own region and all other regions and exchanges this information withGSMs in other regions.

As shall be described in greater detail hereafter, each GSM performsconnection load balancing by directing a client connection to the mostappropriate database instance. The instance is determined based onmetrics that the GSM receives from all instances, estimated networklatency/bandwidth and region affinity of the service.

According to another aspect, each GSM manages cardinality and failoverof global services by starting, stopping and moving them betweeninstances and databases. GSMs may also send advisory messages toclients, to recommend the degree to which the clients should use eachconnection in a connection pool to obtain a particular service.

According to one embodiment, each GSM also monitors databases instances,generates and publishes events when an instance, database or network godown. GSM also generates and publishes events for clients in the localregion according to performance metrics it receives from all instancesin the cloud and integrating them with estimated network latency. Whenall GSMs in a region are down, GSMs from the buddy region take overgeneration of events for the region. Buddy regions shall be described ingreater detail hereafter.

Database Pools

In one implementation, databases included in a database cloud can begrouped into database pools. A database pool is a set of databaseswithin a database cloud that provides a unique set of global servicesand belongs to a certain administrative domain, e.g. HR Pool, Salespool. A database can only belong to a single database pool. It is notnecessary that all databases in a pool provide the same set of globalservices; an individual database can support only a subset of servicesprovided by the pool. However, all databases that provide the sameglobal service must belong to the same pool. A database pool can have adedicated set of administrators that can only administer this pool.Therefore database pools simplify administration and improve security inlarge database clouds.

The Global Data Service Catalog

According to one embodiment, a global data service catalog (GDS catalog)is another component of the global data service framework 100. The GDScatalog is a repository of information maintained by the GDS framework100. The information stored in the GDS catalog may include, for example,the configuration and the run-time status of the database cloud. Morespecifically, the information maintained in the GDS catalog may includedata on global services, the attributes of each of the global services,and all logical and physical components of the cloud: database pools,regions, global service managers, and database instances. The catalogmay also contain data on replication and network topologies related tothe cloud.

Examples of the information items that may be maintained within the GDScatalog include, but are not limited to:

-   where the databases within the database cloud are organized into    “database pools”, the members of each database pool-   which databases are enabled for each global service-   which databases are preferred for each global service-   the “cardinality” specified for each global service

How the various pieces of information that are stored in the GDS catalogare used by the service framework 100 shall be described in greaterdetail hereafter.

In one embodiment, there is a single GDS catalog for each databasecloud. However, multiple replicas of the catalog may be maintained forhigh-availability purposes. In FIG. 2, the GDS catalog is illustrated asstored in a GDS catalog database 270. However, the GDS catalog may bestored in any type of repository, including a flat file. Further, whileGDS catalog database 270 is depicted as a single storage device, GDScatalog database 270 may be stored on several storage devices, each ofwhich may store all or a distributed portion of the GDS catalog.

Handling Connection Requests

As mentioned above, when the global service framework 100 receives aconnection request from a client, the global services framework 100selects which database server instances the client should be connectedto, and facilitates the connection of the client to the selecteddatabase server instances.

According to one embodiment, clients communicate their connectionrequests to the global services framework 100 by sending theirconnection requests to one of their local global service managers. Forexample, a request from client 152 to establish a connection may be sentto global service manager 202 or 204, both of which are local to client152. A connection request from client 162 may be sent to global servicemanager 206 or 208. Similarly, a connection request from client 164 maybe sent to global service manager 210.

Under some circumstances, a client may send a connection request to aglobal service manager of a region with which the client is notassociated. This situation may occur, for example, if none of the localglobal service managers are available for some reason, such as all thedatabases in the local region are down. For example, if global servicemanagers 202 and 204 of region X are both down, client 152 may send itsconnection requests to global service manager 206 of region Y, eventhough global service manager 206 is not local to client 152. Note thatthis reconnect can be done automatically by client middleware; so eachapplication does not need to implement this logic.

The global service manager that receives the connection request thenselects the database server instance(s) with which to connect the clientthat sent the request. For the purpose of illustration, it shall beassumed that client 154 sends a connection request to global servicemanager 202. In response, global service manager 202 may cause aconnection to be formed between client 154 and database server instance102. According to one embodiment, global service managers are onlyinvolved in establishing connections. In such an embodiment, once theconnections are established, clients talk directly to the databasesystems to which they have been connected.

In the example given above, a single connection is established inresponse to the connection request of client 154. However, in manysystems, clients establish client-side connection pools that may includeconnections to many database server instances. Further, a client'sconnection pool may also include multiple connections to the samedatabase server instance. Thus, the connection request from client 154may request the establishment of five connections, and in response tothe request the global service manager 202 may establish two connectionsbetween client 154 and database server instance 102, one connectionbetween client 154 and database server instance 104, one connectionbetween client 154 and database server instance 108, and one connectionbetween client 154 and database server instance 110.

Buddy Regions

According to one embodiment, each region has a designated “buddyregion”. In general, the buddy region of a particular region is a regionwhose GSMs will take over responsibilities of the particular region ifthe particular region's GSMs are prevented from handling theresponsibilities.

For example, when all GSMs in a region are down, one or more of the GSMsin the buddy region start acting as listeners for the region with failedGSMs. Thus, if GSMs 202 and 204 of region X go down, and region Y is thebuddy region of region X, then one of GSMs 206 and 208 from region Y maystart acting as the listener for region X, while it continues to act asa listener for region Y. Under these circumstances, if client 156 fromregion X issues a connection request, the connection request will behandled by one of the GSMs 206 and 208 from region Y.

Significantly, using a GSM in a certain region to establish a databaseconnection does not mean that the database to which the GSM chooses toestablish the connection will be in the same region as GSM. Any GSM canforward a connection request to any database that provides theappropriate service. Thus, even though GSMs 202 and 204 are down, GSM206 (which resides in region Y) may cause client 156 to be connected todatabase server instance 107 (which resides in region X).

The GSMs of buddy region Y may assume all responsibilities normallyhandled by the GSM's of region X, not merely the responsibility oflistening for connection requests. For example, one or more of the GSMsof buddy region Y may also take over the responsibility for generatingevents for region X. As another example, in addition to generatingmetrics for local clients, a GSM may also need to calculate metrics forthe region for which it is designated as the buddy, and publish them forclients residing that region. This may be necessary, for example, whenall GSMs in that region are down.

Registration

According to one embodiment, both global services, and the databaseinstances that are available to run the global services, register withthe GDS framework. Specifically, with respect to the global services,the registration information specifies a set of attributes associatedwith each global service. The attributes control when and where theservices are started, how and if connections to them are load balanced,how and if the connections are failed over, and more. According to oneembodiment, the attributes that are registered for a service specify,among other things:

-   Run time load balancing goal-   Connection time load balancing goal-   Role-based services-   Connection fail-over properties-   Preferred/available databases-   Replication lag-   Region affinity

With respect to database instance registration, when a database joinsthe database cloud, or re-starts after a shutdown, the databaseregisters with all GSMs in the cloud. The GSM that receives theregistration responds by querying the GDS Catalog to determine whichservices can be started on the database that is being registered. Thoseservices are then started on the database server instance, and databaseserver instance thereby becomes a candidate for connections with clientsthat require those global services.

Factors for Selecting where to Establish Connections

As explained above, global service managers are responsible forselecting which connections to establish in response to a connectionrequest from a client. According to one embodiment, the global servicemanagers make such selections based on a variety of factors in order toefficiently balance the connection loads among the database serverinstances that are available to the global data service framework 100.Those factors may include, for example:

-   which database server instances are able to provide services    required by the requestor-   which database server instances have been designated as the    “preferred” instances for the services required by the requestor-   performance metrics of the database server instances-   the region to which the requesting client belongs-   the region to which the database server instances belongs-   latency between regions-   region affinity of the requested global service

Each of these factors shall be described in greater detail hereafter.However, these factors are merely examples of the factors that theglobal data service framework 100 may take into account in selectingwith which database server instances to connect a given client. Thespecific factors, and the weights given to each, may vary fromimplementation to implementation.

Region Affinity

According to one embodiment, each global service may have a stronger“affinity” to some regions than to other regions. Specifically, in oneembodiment, each global service has two parameters: ‘locality’ and‘region_failover’, which allow the user to specify a degree of serviceaffinity to a region. Depending on the value of these parameters,various policies may be supported. For example, a default regionaffinity policy may be in effect when the locality parameter is set to“anywhere” (default). In this case, a client connection request isrouted to the best database that can satisfy the load balancing goal forthe requested service. The choice of the database is based on itsperformance and network latency between the regions where the client anddatabase reside. The target database can be chosen from any region. Ifdatabases in different regions are equally loaded, this policy givespreference to a local region, i.e. a client gets connected to a databasethat belongs to the same region. An inter-region connection is made onlyif the difference in database performance between regions overweighsnetwork latency.

If there are preferred/available databases specified for a service whichlocality parameter is set to “anywhere”, service cardinality ismaintained at the database pool level. This means that, if a servicegoes down on a preferred database, it will be started on an availabledatabase and the number of service providers in the pool will remain thesame. When starting the service on an available database the preferenceis given to a database in the region where the service went down. Ifthere is no available database for this service in the local region, anavailable database is chosen randomly from a nearby region.

When the locality parameter is set to “local_only”, a client connectionrequest is routed to the best database in the client's region that cansatisfy the load balancing goal for the requested service. The choice ofthe database is based only on its performance. A “local region only”service can be provided in multiple regions at the same time, but aclient from one region never gets connected to a database in anotherregion.

If there are preferred/available databases specified for a service whichlocality parameter is set to “local_only”, service cardinality ismaintained at the regional level. This means that, if a service goesdown on a preferred database, it will be started on an availabledatabase in the same region, so the number of service providers in theregion will remain the same. If there is no available database for thisservice in the local region, no action is taken and the servicecardinality decreases. If there is no database in the local regionoffering the service, a client connection request is denied. Thisbasically means that, if a service has affinity to local region,database cardinality of the service is maintained independently in eachregion.

An “affinity to local region with inter-region failover” policy is ineffect when the locality parameter is set to “local_only” and the‘region_failover’ option is specified. The policy is the same as“local_only” with the only difference that, if there are no databases inthe local region offering a service, instead of denying a clientrequest, it is forwarded to the best database (in terms of load andnetwork latency) in another region that has the requested servicestarted. Such service failover does not cause the service to be startedon an available database in another region. The reason for not startingthe service is that, with affinity to local region, database cardinalityis maintained per region and should not change as a result of servicefailure in another region. If regional databases become overloadedbecause of inter-region failover, then a database administrator (DBA)can manually add a preferred database for the service.

Database Server Instance Performance Metrics

With respect to performance metrics, in one embodiment, each of thedatabase server instances periodically reports its performance metricsto the global data services framework 100. In one embodiment, eachdatabase server periodically sends its performance metrics to eachglobal service manager in the GDS framework 100. In an alternativeembodiment, each database server instance reports its performancemetrics initially to a local global service manager, and each globalservice manager may communicate its locally-obtained performanceinformation to global service managers in other systems. In the latterembodiment, database server instance 110 may periodically report itsperformance information to global service manager 210, which is local todatabase server instance 110. In turn, global service manager 210 maycommunicate the performance information from database server instance110 to global service managers in each of systems 130 and 132.

The performance information received from the database server instancesis an example of one type of information that the global data servicesframework 100 may maintain within GDS catalog database 270. In oneembodiment, each global service manager receives, stores, and maintainsits own separate copy of the performance metrics of all database serverinstances managed by the GDS framework 100.

Because the performance metrics are reported by the database serverinstances, the metrics are likely to be more accurate than ifperformance of the database server instances where simply monitored froman external source. Further, with the database server instancesreporting their metrics, the GDS framework 100 need not incur theadditional overhead associated with such externally performed monitoringoperations. Nevertheless, the techniques described herein are alsoapplicable to systems in which performance information is acquired byperforming external monitoring of the database server instances thatbelong to the database cloud.

The specific performance metrics reported by each database serverinstance may vary from implementation to implementation, and thetechniques described herein are not limited to any particular set ofperformance metrics. As an example, the performance metrics may include,but are not limited to:

-   number and type of CPUs-   current CPU utilization-   memory size and current consumption-   I/O bandwidth to the storage system and the current I/O load

According to one embodiment, the above-listed metrics are collected perdatabase instance. The following metrics are collected both per databaseinstance and also per each service running on an instance:

-   average response time for a database request-   average number of database requests executed per second-   average number of parallel database sessions-   average time a database request spends waiting for busy resources-   average time a database request spends waiting for locks, latches

Inter-Region Latency

As mentioned above, inter-region latency may be one of the factors usedto determine with which databases a client should be connected. In oneembodiment, the latency values upon which this determination is basedare estimates of the network round-trip time between the global servicemanagers in two regions. These estimations, in turn, may be based onround-trip data collected from multiple messages over some time period.

For example, each of the global service managers may monitor the latencyincurred by communications with the global service managers in otherregions. Thus, the latency incurred by a message sent by global servicemanager 210 to global service manager 202 may serve as an indication ofthe latency between the regions (X and Z) that correspond to systems 130and 134. Similarly, the latencies incurred by messages from globalservice manager 206 to global service managers 204 and 210 respectivelyindicate the latencies between the region Y of system 132 and theregions (X and Z) of systems 130 and 134.

Required Data Sets

In the situation where not all data sets are replicated at all systems,the data set to which a client requires access is an important factor indetermining which database server instances to connect the client with.The global data service framework 100 may obtain information about thedata sets to which a client requires access in any of a variety of ways.For example, configuration data of the client may indicate the dataset(s) to which the client requires access. As another example, theconnection request sent by a client may include metadata that indicatesthe data sets to which the client requires access. According to oneembodiment, clients use different service names to identify differentdata sets.

For the purpose of illustration, assume that each of data sets A, B, Cand D corresponds to a different range of data items within adistributed database. Under these circumstances, a request issued byclient 154 may indicate the range of the data items to which client 154requires access. Based on the range information specified in therequest, the ranges associated with the data sets, and the mappingbetween the data sets and the systems, the global data service framework100 is able to determine which database server instances have access tothe data required by client 154. As shall be explained in detailhereafter, any database server instance that does not have access to thedata required by client 154 may be disqualified as a connectioncandidate for client 154.

Connection Candidate Selection

Referring to FIG. 3, it illustrates how the global data serviceframework 100 responds to a request from a client to establish a pool ofconnections, according to one embodiment. In step 300, all databaseserver instances are initially established as connection candidates. Atstep 302, the global data service framework 100 removes from the set ofconnection candidates those database server instances that do not haveaccess to the data sets used by the client that submitted the request.

For the purposes of illustration, it shall be assumed that client 154issued the request, and that client 154 requires access only to data setA. Since all of systems 130, 132 and 134 have replicas of data set A, nodatabase server instances are removed from the set of connectioncandidates during step 302. However, if client 154 required access todata set B, then database server instance 110 would be removed from theset of connection candidates, because database server instance 110belongs to a system 134 that does not have a replica of data set B.

At step 304, instances that have access to the required data set, butwhich are not running the required service, are removed from theconnection candidate set. An instance can have the service down, forexample, because the instance is not “preferred” and the desired servicecardinality is reached, because the replication lag exceeds the maximumacceptable value, or because of a failure or planned maintenance.

At step 306, a subset of candidates is selected based on regionaffinity. For example, if the locality parameter of the requestedservice is set to “local_only”, then step 306 involves selecting onlythose remaining candidates that are in the same region as the clientthat is requesting the service. On the other hand, if the localityparameter of the service is set to “anywhere”, then step 306 may selectall remaining candidates, regardless of the region to which they belong.

At step 308, one or more instances from the subset are selected based onnetwork latency and the database response time. For example, in oneembodiment, if (network latency+response time) for a database in aremote region is less than the database response time in the localregion, then the database instance in the remote region is chosen.

At step 310, connections are established between the client and theremaining candidates.

The selection logic illustrated in FIG. 3 is merely an example of howvarious factors may be accounted for in the decision of which databaseserver instances, from all instances available in the database cloud, aclient connects to in response to a connection request. The actual logicused, and factors accounted for, may vary from implementation toimplementation. For example, in an alternative embodiment, step 308 isskipped and an equal number of connections are established to eachdatabase instance in the subset selected in step 306.

Runtime Load Balancing

Using the techniques described above, the global data service framework100 may intelligently balance the connection loads among the variousdatabase server instances available in a distributed replication system.However, even an optimal distribution of connections does not guaranteethat, during runtime, some database server instances will be overloadedwhile other are underutilized.

For example, assume that after an optimal distribution of connectionshas been established, all clients 152-156 include, within theirrespective connection pools, a connection to database server instance102. If all clients use their respective connection to database serverinstance 102 for most or all of their database requests, database serverinstance 102 will become overworked while the remaining database serverinstances 104, 106, 108 and 110 go underutilized.

Thus, according to one embodiment, in addition to connection loadbalancing, the GDS framework supports balancing of work requests at runtime in situations where a connection pool connects a client to multipledatabase server instances that provide the same global service. In oneembodiment, the choice of a connection for a unit of work is made byclient-side connection pools and is based on service metrics that showrelative performance of database instances for a service. The GDSframework provides clients with such metrics for all instances acrossmultiple databases. In one embodiment, when calculating metrics, the GDSframework takes into account instance load, run-time balancing goals(service time, throughput), network latency, and all other factorsdescribed above upon which connection-time load balancing is based.

Run time load balancing improves performance by minimizing responsetime, or maximizing throughput for a given service by spreading theservice workload as needed across local and remote database instancesthat are available to offer the service. Intelligent load balancingalgorithms guarantee that the framework gracefully reacts to changes inworkload and availability of resources.

In one embodiment, to facilitate runtime load balancing, the global dataservice framework 100 sends advisory messages to the clients. Forexample, in one embodiment, global service manager 202 periodicallycommunicates to client 152 which database server instance, of thedatabase server instances in the connection pool of client 152, iscurrently the database server instance to whom client 152 should sendwork requests.

The appropriate database server instance for any given client may varyover time based on a variety of factors. For example, assume that theconnection pool of client 152 includes database server instances 102,108 and 110. At time T1, if none of the database server instances areparticularly busy, global service manager 202 may indicate to client 152that database server instance 102 should be used because database serverinstance 102 is local to client 152. However, at time T2, global servicemanager 202 may indicate to client 152 that database server instance 108should be used. This change in recommendation may occur, for example, ifdatabase server instance 102 is overloaded at time T2.

The global service managers may be configured to send database serviceinstance advisory messages to the clients at fixed intervals, or inresponse to changes within the system. In an embodiment where advisorymessages are sent in response to changes, the changes that trigger thesending of advisory message may include, for example, significantchanges in the load on any given database server instance, the removalor addition of a database server instance, the generation of an error byone or more of the database server instances, an increase or decrease inlatency between regions, etc.

The advisory messages need not merely identify a single database serverinstance for a given service. For example, an advisory message to aclient may indicate the percentage of that client's work that should besent to each of a plurality of database server instances. Thus, anadvisory message sent from global service manager 202 to client 152 mayindicate that client 152 should send 50% of its work to database serverinstance 102, 35% of its work to database server instance 108, and 15%of its work to database server instance 110. The recommendation given insuch advisory messages remain in effect at a client until the clientreceives a new advisory message. The new advisory message may specifydifferent set of percentages and/or a different set of database serverinstances. For example, the next advisory message to client 152 mayindicate that client 152 should send 10% of its work to database serverinstance 102, 85% of its work to database server instance 108, and 5% ofits work to database server instance 110.

To achieve load balancing goals, the runtime load balancing techniquesdescribed herein may be used in conjunction with another mechanism,referred to as “connection gravitation”. Connection gravitation movesconnections at runtime from instances which have too many connectionsfor the current workload to instances that do not have enoughconnections. Connection gravitation may be implemented in the clientcode, and is described in U.S. patent application Ser. No. 12/938,545,filed Nov. 2, 2010, the entire contents of which are incorporatedherein.

“Preferred” and “Available” Instances

According to one embodiment, a user can specify “preferred” and“available” databases for a global service. Normally, the global serviceis provided by the database server instances that have been designatedas “preferred” for that global service. If one of the preferreddatabases fails to provide the service, the service is automaticallyrelocated to one of the database server instances that was identified as“available” for that global service.

Therefore, GDS framework maintains service cardinality (number ofdatabases offering a service) according to the number of preferreddatabases specified. A singleton global service is a special case ofglobal service cardinality, when there is only one preferred databasefor the service at any time. Support for the singleton service isespecially important in case of active/active databases to guaranteethat only the current ‘master’ copy of data can be modified.

When preferred database instances have been specified for a globalservice, the GDS framework 100 attempts to ensure that a service alwaysruns on all preferred databases that have been specified for the globalservice. Therefore the number of preferred databases is referred to asthe database cardinality of a service. At least one preferred databasehas to be specified for a service.

When adding or modifying a service, the user can also specify a list ofavailable databases for this service. If one of the preferred databasesfails to provide a global service, the GDS framework 100 relocates theservice to one of the available databases to maintain the desireddatabase cardinality for the service. If a failed service was running ona single database and there is no available database for this service,GDS framework 100 alerts the administrator that the service cannot beprovided.

Specifically, if, after a preferred database failure, the number ofavailable databases is insufficient to maintain database cardinality fora service, the actual service cardinality will fall below the number ofpreferred databases. Also, when the GDS framework 100 cannot be notifiedabout a failure of a global service on one or more databases, e.g.because of a network outage, it is assumed that the service is stillrunning on those databases. Therefore, specifying N preferred databasesfor a service only guarantees that the service will never run on morethan N databases, but it can sometimes run on less than N databases.

In one embodiment, when an “available” database for a particular globalservice fails, the global service is relocated to another “available”database for that global service. In an alternative embodiment, aservice may be relocated from an available database back to a preferreddatabase.

In a system that uses role-based services, a role-based service can bestarted on a database only if the database is listed as preferred oravailable for the service AND the database's role (whether it is aprimary or standby) corresponds to the role specified for the service.For example, a service that can run on any database in a configurationas long as it is a primary should be specified with the role ‘primary’and have all databases in the configuration as preferred. Whenspecifying preferred/available databases under these circumstances,potential side effects of role transitions on service cardinality shouldbe considered.

Global Singleton Service

A global singleton service is a service that is offered on only onedatabase of a database pool at a time, i.e. a global service whichdatabase cardinality is equal to 1. A singleton service guarantees thatonly a master (primary) data replica can be updated and, by doing so,prevent data corruptions caused by updating multiple replicas at thesame time.

In a configuration that uses role-based services, only the primarydatabase can be updated, and there is at most one primary at any time.Therefore the singleton property is implicitly provided for any servicewith the role attribute set to ‘primary’ no matter how many preferred oravailable databases are specified for the service.

In multi-master environments, users may partition mastership of theirdata across multiple databases. In this case, updates must go to theprimary site for their chunk of the data. To support this functionality,a separate update service should be created for each chunk of data andonly one preferred database specified for each service.

Policies for Selecting Instances to Recommend During Runtime

To perform runtime load balancing, a connection request is directed tothe best instance in the distributed database system that is currentlyproviding the services required by the requesting client. In oneembodiment, the instance is chosen based on its load, load balancinggoal, and network latency between the client and server. A degree ofaffinity to local servers should be respected.

As mentioned above, a client request for a global service is directed toa database server in close geographic proximity with the client, unlessall local servers are overloaded and a remote server can providesignificantly better quality of service. However, in some cases, forexample, to take advantage of data caching on a local server, the usermight want to always direct requests to local servers. According to oneembodiment, the GDS framework supports various types of client-serveraffinity that can be specified as a service attribute.

Handling Replication Lag

For performance reasons, distributed database systems often useasynchronous replication of data between databases. This means thatthere is a possibility of a delay in between the time an update iscommitted to data on a primary database and the time this update appearson a replica. In other words, a replica can have stale data because theupdates committed to the replica can be lagging behind the updatescommitted to the master database.

According to one embodiment, the GDS framework 100 allows applicationsto differentiate between global services that provide real time datafrom services that can return stale data because of replication lag. Forapplications that can tolerate a certain degree of lag, the GDSframework 100 allows the user to set a maximum acceptable lag value inseconds. In one embodiment, tolerance for replication lag is specifiedusing the global service parameter—lag.

If lag is not acceptable, requests for such service will be forwardedonly to a primary database or its replica that is synchronized with theprimary. If lag is acceptable and a maximum is specified, then a servicerequest is forwarded to a database that does not lag the primary by alonger time than the specified value. If a database falls behind theprimary by a longer time interval than the setting permits, the serviceis disabled and clients connected to it are notified. In this case, newclient connections are routed to a database that satisfies the lagrequirement for the service.

For applications that cannot tolerate any replication lag, globalservices should be configured with the ‘lag’ parameter set to 0.Requests for such service will be forwarded only to a primary (master)database, or to its replica that is synchronized with the primary.

For many applications it is acceptable to read stale data as long as itis consistent. Such applications can use global services running on anydatabase replica no matter how big the replication lag is. A globalservice that can return data with unlimited staleness should beconfigured with the ‘lag’ parameter set to “ANY”. In case of a databasefailure, such service can be moved to any other database where it isenabled. “ANY” is the default value for the parameter.

If the lag parameter for a service is set to a any numerical value, aclient request can be forwarded only to a database that is not laggingthe primary replica by a longer time that the parameter value. If thereis no such database, the connection request will fail.

According to one embodiment, to support global services with the lagparameter, each GSM periodically receives lag values from databases andgenerates a ‘service member down’ event if the lag on a particulardatabase exceeds the value specified for a service. The event will forceclients of the service to disconnect from the database. New requests forthe service will be routed to a database that satisfies the specifiedlag value.

In an alternative embodiment, lag values are not sent to the GSM.Instead, each database server monitors lag values for its services, andshuts down any service it is running service when the maximum lag forthe service is exceeded. The service may be brought back up by thedatabase server when the lag value is within the acceptable range forthe service.

In case of a database failure, a client connection might be routed toanother database that satisfies the maximum lag value specified for theservice, but lags behind the first database. Such “going back in time”can create data consistency problems for some applications. This problemmay be handled in a variety of ways, such as informing the client of thesituation.

According to one embodiment, the “going back in time” problem is avoidedby having the requesting client tell GSM what its current time is. Basedon this information, the GSM can ensure that the database that isselected for the failover provides data that is sufficiently current tosatisfy the application's requirements.

Handling Failures

According to one embodiment, if a database fails to provide a service, aclient request is forwarded to another database that offers thisservice. Depending on service cardinality and failover policy, adatabase failure can also cause starting the service on anotherdatabase.

Because the GDS framework provides disaster recovery and businesscontinuity in case of failures, the framework itself is highlyavailable. Thus, mechanisms are provided to allow the GDS framework tocontinue to work (although possibly in a degraded mode) in case of asingle failure of any framework component, network partitioning and evena complete site failure. For high availability and performance reasons,data about parameters and status of global services and GDS frameworkcomponents is replicated in multiple repositories. When networkpartitioning and/or failure of a database or GDSF component causes datadiscrepancies across repositories, an automatic cross-check is triggeredthat verifies and potentially restores mutual consistency of data storedin different components of the system.

According to one embodiment, in case of a service or database failure, aservice that was running on the database fails over to another databasewhere it is enabled, but not running yet (assuming that the databaserole matches the service role). “Preferred” databases are considered forthe failover target before “available” databases. After a service hasbeen moved from one database instance to another, the GDS framework 100may send advisory messages to all clients to indicate that futurerequests for that service should go to the newly designated server.Those advisory messages may be sent immediately in response to thefailover of the service, or in the next periodic advisory message thatis sent after the failover.

According to one embodiment, when a service moves to an availabledatabase, the GDS framework 100 does not move the service back when thepreferred database restarts. If necessary, a user can always manuallyrelocate the service back to the preferred database after is hasrestarted. This can be done gracefully without termination of activesessions.

As mentioned above, a service cannot failover from a database in oneregion to a database in another region when the locality parameter isset to LOCAL_ONLY and the inter-region failover is not enabled.

According to one embodiment, all global service managers monitor serviceavailability on all databases in the database cloud. When a servicecannot be provided anymore because of a failure, the first GSM thatnotices it and connects to the catalog database will try to start theservice on an available database. If the service failover cannot be donebecause there is no available database offering this service, the GSMcreates an alert in the catalog database about the inability to maintainthe specified cardinality of the service. The alert can trigger anautomatic notification sent to the pool administrator.

A GSM cannot perform an automatic service failover if it is unable toconnect to the cloud catalog. In this case the GSM can create an alerton a cloud database to which it is able to connect.

Hardware Overview

According to one embodiment, the techniques described herein areimplemented by one or more special-purpose computing devices. Thespecial-purpose computing devices may be hard-wired to perform thetechniques, or may include digital electronic devices such as one ormore application-specific integrated circuits (ASICs) or fieldprogrammable gate arrays (FPGAs) that are persistently programmed toperform the techniques, or may include one or more general purposehardware processors programmed to perform the techniques pursuant toprogram instructions in firmware, memory, other storage, or acombination. Such special-purpose computing devices may also combinecustom hard-wired logic, ASICs, or FPGAs with custom programming toaccomplish the techniques. The special-purpose computing devices may bedesktop computer systems, portable computer systems, handheld devices,networking devices or any other device that incorporates hard-wiredand/or program logic to implement the techniques.

For example, FIG. 4 is a block diagram that illustrates a computersystem 400 upon which an embodiment of the invention may be implemented.Computer system 400 includes a bus 402 or other communication mechanismfor communicating information, and a hardware processor 404 coupled withbus 402 for processing information. Hardware processor 404 may be, forexample, a general purpose microprocessor.

Computer system 400 also includes a main memory 406, such as a randomaccess memory (RAM) or other dynamic storage device, coupled to bus 402for storing information and instructions to be executed by processor404. Main memory 406 also may be used for storing temporary variables orother intermediate information during execution of instructions to beexecuted by processor 404. Such instructions, when stored innon-transitory storage media accessible to processor 404, rendercomputer system 400 into a special-purpose machine that is customized toperform the operations specified in the instructions.

Computer system 400 further includes a read only memory (ROM) 408 orother static storage device coupled to bus 402 for storing staticinformation and instructions for processor 404. A storage device 410,such as a magnetic disk, optical disk, or solid-state drive is providedand coupled to bus 402 for storing information and instructions.

Computer system 400 may be coupled via bus 402 to a display 412, such asa cathode ray tube (CRT), for displaying information to a computer user.An input device 414, including alphanumeric and other keys, is coupledto bus 402 for communicating information and command selections toprocessor 404. Another type of user input device is cursor control 416,such as a mouse, a trackball, or cursor direction keys for communicatingdirection information and command selections to processor 404 and forcontrolling cursor movement on display 412. This input device typicallyhas two degrees of freedom in two axes, a first axis (e.g., x) and asecond axis (e.g., y), that allows the device to specify positions in aplane.

Computer system 400 may implement the techniques described herein usingcustomized hard-wired logic, one or more ASICs or FPGAs, firmware and/orprogram logic which in combination with the computer system causes orprograms computer system 400 to be a special-purpose machine. Accordingto one embodiment, the techniques herein are performed by computersystem 400 in response to processor 404 executing one or more sequencesof one or more instructions contained in main memory 406. Suchinstructions may be read into main memory 406 from another storagemedium, such as storage device 410. Execution of the sequences ofinstructions contained in main memory 406 causes processor 404 toperform the process steps described herein. In alternative embodiments,hard-wired circuitry may be used in place of or in combination withsoftware instructions.

The term “storage media” as used herein refers to any non-transitorymedia that store data and/or instructions that cause a machine tooperate in a specific fashion. Such storage media may comprisenon-volatile media and/or volatile media. Non-volatile media includes,for example, optical disks, magnetic disks, or solid-state drives, suchas storage device 410. Volatile media includes dynamic memory, such asmain memory 406. Common forms of storage media include, for example, afloppy disk, a flexible disk, hard disk, solid-state drive, magnetictape, or any other magnetic data storage medium, a CD-ROM, any otheroptical data storage medium, any physical medium with patterns of holes,a RAM, a PROM, and EPROM, a FLASH-EPROM, NVRAM, any other memory chip orcartridge.

Storage media is distinct from but may be used in conjunction withtransmission media. Transmission media participates in transferringinformation between storage media. For example, transmission mediaincludes coaxial cables, copper wire and fiber optics, including thewires that comprise bus 402. Transmission media can also take the formof acoustic or light waves, such as those generated during radio-waveand infra-red data communications.

Various forms of media may be involved in carrying one or more sequencesof one or more instructions to processor 404 for execution. For example,the instructions may initially be carried on a magnetic disk orsolid-state drive of a remote computer. The remote computer can load theinstructions into its dynamic memory and send the instructions over atelephone line using a modem. A modem local to computer system 400 canreceive the data on the telephone line and use an infra-red transmitterto convert the data to an infra-red signal. An infra-red detector canreceive the data carried in the infra-red signal and appropriatecircuitry can place the data on bus 402. Bus 402 carries the data tomain memory 406, from which processor 404 retrieves and executes theinstructions. The instructions received by main memory 406 mayoptionally be stored on storage device 410 either before or afterexecution by processor 404.

Computer system 400 also includes a communication interface 418 coupledto bus 402. Communication interface 418 provides a two-way datacommunication coupling to a network link 420 that is connected to alocal network 422. For example, communication interface 418 may be anintegrated services digital network (ISDN) card, cable modem, satellitemodem, or a modem to provide a data communication connection to acorresponding type of telephone line. As another example, communicationinterface 418 may be a local area network (LAN) card to provide a datacommunication connection to a compatible LAN. Wireless links may also beimplemented. In any such implementation, communication interface 418sends and receives electrical, electromagnetic or optical signals thatcarry digital data streams representing various types of information.

Network link 420 typically provides data communication through one ormore networks to other data devices. For example, network link 420 mayprovide a connection through local network 422 to a host computer 424 orto data equipment operated by an Internet Service Provider (ISP) 426.ISP 426 in turn provides data communication services through the worldwide packet data communication network now commonly referred to as the“Internet” 428. Local network 422 and Internet 428 both use electrical,electromagnetic or optical signals that carry digital data streams. Thesignals through the various networks and the signals on network link 420and through communication interface 418, which carry the digital data toand from computer system 400, are example forms of transmission media.

Computer system 400 can send messages and receive data, includingprogram code, through the network(s), network link 420 and communicationinterface 418. In the Internet example, a server 430 might transmit arequested code for an application program through Internet 428, ISP 426,local network 422 and communication interface 418.

The received code may be executed by processor 404 as it is received,and/or stored in storage device 410, or other non-volatile storage forlater execution.

In the foregoing specification, embodiments of the invention have beendescribed with reference to numerous specific details that may vary fromimplementation to implementation. The specification and drawings are,accordingly, to be regarded in an illustrative rather than a restrictivesense. The sole and exclusive indicator of the scope of the invention,and what is intended by the applicants to be the scope of the invention,is the literal and equivalent scope of the set of claims that issue fromthis application, in the specific form in which such claims issue,including any subsequent correction.

What is claimed is:
 1. A method comprising: receiving a connectionrequest from a client that requires access to a data set stored in adistributed replication environment; wherein the distributed replicationenvironment includes a plurality of database systems, each of whichmaintains a separate copy of the data set to which the client requiresaccess; wherein each of the plurality of database systems includes oneor more database server instances; in response to the connectionrequest, performing the steps of: selecting at least one database serverinstance, from among a set of database server instances that includes atleast one database server instance from each of the plurality ofdatabase systems, based on one or more selection criteria; wherein everydatabase server instance in the set of database server instances hasaccess to a copy of the data set to which the client requires access;and facilitating establishment of one or more connections between theclient and the at least one database server instance; wherein the methodis performed by one or more computing devices.
 2. The method of claim 1wherein the set of database server instances that includes at least onedatabase server instance from each of the plurality of database systemsdo not have direct access to the copies of the data set that reside atthe others of the plurality of database systems.
 3. The method of claim1 wherein the plurality of database systems is organized into regions,and the one or more selection criteria include latency of communicationbetween the regions.
 4. The method of claim 3 wherein the at least onedatabase server instance includes a particular database server instancethat is in a region that is different than the region that is local tothe client.
 5. The method of claim 1 wherein the one or more selectioncriteria include that the at least one database server instance isdesignated as a preferred database server for a service required by theclient.
 6. The method of claim 1 wherein the one or more selectioncriteria include performance metrics reported by the database serverinstances that belong to the plurality of database systems.
 7. Themethod of claim 1 wherein the one or more selection criteria includethat the at least one database server belongs to the same databasesystem with which the client is associated.
 8. The method of claim 1wherein the at least one database server instance is selected based, atleast in part, on anticipated changes in performance or availability ofat least one of the plurality of database systems.
 9. A methodcomprising: selecting at least one database server instance, from aplurality of database server instances that have access to a data setrequired by a particular service, to recommend to a particular clientfor the particular service; wherein every database server instance inthe plurality of database server instances has access to a copy of thedata set to which the particular service requires access; communicatingto the particular client an advisory message that recommends the atleast one database server instance for work requests associated with theparticular service; wherein each of a plurality of database systemsmaintains a separate copy of the data set; wherein the plurality ofdatabase server instances includes at least one database server instancefrom each of the plurality of database systems; wherein the method isperformed by one or more computing devices.
 10. The method of claim 9wherein the plurality database server instances do not have directaccess to the copies of the data set that reside at the others of theplurality of database systems.
 11. The method of claim 9 wherein theadvisory message is sent in response to a change in one or more of theplurality of database systems.
 12. The method of claim 9 wherein theadvisory message is sent in response to a certain interval of timehaving elapsed since the sending of a previous advisory message.
 13. Themethod of claim 9 wherein the advisory message recommends two or moredatabase server instances for work requests associated with theparticular service.
 14. The method of claim 9 wherein: the particularclient is associated with a first database system of the plurality ofdatabase systems; and selecting at least one database server instanceincludes selecting a second database server instance that belongs to asecond database system, of the plurality of database systems, that isdifferent than the first database system.
 15. The method of claim 14wherein the at least one database server instance also includes a firstdatabase server instance that belongs to the first database system. 16.The method of claim 9 wherein the at least one database server instanceis selected based, at least in part, on latency of communication betweenthe plurality of database systems.
 17. The method of claim 9 wherein theat least one database server instance is selected based, at least inpart, on whether the at least one database server instance is designatedas a preferred database server instance for the particular service. 18.The method of claim 9 wherein the at least one database server instanceis selected based, at least in part, on performance metrics reported bythe database server instances that belong to the plurality of databasesystems.
 19. The method of claim 9 wherein the at least one databaseserver instance is selected based, at least in part, on whether the atleast one database server belongs to the same database system with whichthe particular client is associated.
 20. The method of claim 9 furthercomprising: detecting that the particular service is no longer availablefrom a database server instance that was providing the particularservice; in response to detecting that the particular service is nolonger available from the database server instance that was providingthe particular service, performing the steps of: selecting a seconddatabase server instance, of the plurality of database server instances,to provide the particular service; wherein the second database serverinstance is selected based, at least in part, on the second databaseserver instance being identified as a database server instance that isavailable to provide the particular service.
 21. The method of claim 9wherein the at least one database server instance is selected based, atleast in part, on whether changes made to the copy of the data setaccessed by the at least one database server instance lag behind changesmade to another copy of the data set by more than a specified thresholdamount of time.
 22. The method of claim 9 wherein the at least onedatabase server instance is selected based, at least in part, onanticipated changes in performance or availability of at least one ofthe plurality of database systems.
 23. One or more non-transitorystorage media storing instructions which, when executed by one or morecomputing devices, cause performance of a method comprising: receiving aconnection request from a client that requires access to a data setstored in a distributed replication environment; wherein the distributedreplication environment includes a plurality of database systems, eachof which maintains a separate copy of the data set to which the clientrequires access; wherein each of the plurality of database systemsincludes one or more database server instances; in response to theconnection request, performing the steps of: selecting at least onedatabase server instance, from among a set of database server instancesthat includes at least one database server instance from each of theplurality of database systems, based on one or more selection criteria;wherein every database server instance in the set of database serverinstances has access to a copy of the data set to which the clientrequires access; and facilitating establishment of one or moreconnections between the client and the at least one database serverinstance.
 24. One or more non-transitory storage media storinginstructions which, when executed by one or more computing devices,cause performance of a method comprising: selecting at least onedatabase server instance, from a plurality of database server instancesthat have access to a data set required by a particular service, torecommend to a particular client for the particular service;communicating to the particular client an advisory message thatrecommends the at least one database server instance for work requestsassociated with the particular service; wherein each of a plurality ofdatabase systems maintains a separate copy of the data set; wherein theplurality of database server instances includes at least one databaseserver instance from each of the plurality of database systems.
 25. Asystem comprising: a plurality of database systems, including a firstdatabase system and a second database system; wherein each of theplurality of database systems maintains a separate copy of a data setused by a service; a plurality of database server instances including atleast one database server instance from each of the plurality ofdatabase systems; a global data service framework configured toestablish connections between clients that belong to the plurality ofdatabase systems and the plurality of database server instances, whereinthe global data service framework is configured to establish connectionsbetween clients that belong to the first database system and a databaseserver instance that belongs to the second database system when certaincriteria are satisfied; wherein the global data service framework isconfigured to send to clients of the plurality of database systemsadvisory messages that indicate from which database server instances, ofthe plurality of database server instances, the clients should requestparticular services.
 26. The system of claim 25 wherein recommendationscontained in the advisory messages are based, at least in part, onperformance metrics sent by the plurality of database server instancesto the global data service framework.